﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace OracleDAL.AlarmManager
{
     public class AlarmStatistics
    {
         /// <summary>
         /// 获得统计方式
         /// </summary>
         /// <returns></returns>
         public DataSet getStatisticsState()
         {
             string strSql = "select ID,NAME,ENAME,AREASTATE,LEVELCODE,CODITIONSTR,TRANSID,TRANSNAME,TRANSTABLE from alarm_statistics where length(LEVELCODE)=4";
             return DBUtility.OracleHelper.Query(strSql);
         }
         /// <summary>
         /// 获得统计方式内容
         /// </summary>
         /// <returns></returns>
         public DataSet getStatisticsContent(string id,string name,string table,string codition)
         {
             string strSql = "";
             if (codition == "")
             {
                 strSql = "select " + id + "," + name + " from " + table + " ";
             }
             else
             {
                 strSql = "select " + id + "," + name + " from " + table + " where "+ codition  +" ";
             
             }
             return DBUtility.OracleHelper.Query(strSql);
         }
         /// <summary>
         /// 创建方案字符串SQL
         /// </summary>
         /// <param name="sqlStr">方案字符串SQL</param>
         /// <returns>执行结果</returns>
         public int excuteSql(string sqlStr)
         {
             return DBUtility.OracleHelper.ExecuteSql(sqlStr);
         }
         /// <summary>
         /// 获得DS
         /// </summary>
         /// <param name="strSql"></param>
         /// <returns></returns>
         public DataSet getDs(string strSql)
         {
             return DBUtility.OracleHelper.Query(strSql);
         }

    }
}
